package com.springboot.ball.controller.ranklist;
import com.alibaba.fastjson.JSONObject;

import com.springboot.ball.service.ranklist.GetRanklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class GetRanklistController {
    @Autowired
    private GetRanklistService getRanklistService;

    @GetMapping("/api/ranklist/getlist/")
    public JSONObject getList(
            @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "4") Integer pageSize) {  // 添加pageSize参数
        return getRanklistService.getRanklist(page, pageSize);  // 传递pageSize到service
    }

}